//
//  NextViewController.m
//  ZXKlineDemo
//
//  Created by wanmeizty on 2018/5/11.
//  Copyright © 2018年 郑旭. All rights reserved.
//

#import "NextViewController.h"
#import "CAShapeLayer+Shadow.h"
@interface NextViewController ()
//@property (nonatomic,strong) CAShapeLayer * shadowLayer;
//
//@property (nonatomic,strong) CAShapeLayer * rectLayer;
@end

@implementation NextViewController

- (void)dealloc{
    NSLog(@"dealloc");
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = [UIColor whiteColor];
    UIBezierPath * bezierPath = [UIBezierPath bezierPath];
    NSLog(@"start");
    for (int i = 0; i < 1000; i ++) {
        
        CAShapeLayer * layer = [CAShapeLayer layer];
//        [bezierPath removeAllPoints];
//        [bezierPath moveToPoint:CGPointMake(100,100 )];
//        [bezierPath addLineToPoint:CGPointMake(100 + i, 100+i + 6)];
//        [layer drawbezierPath:bezierPath fillColor:[UIColor redColor].CGColor strokeColor:[UIColor greenColor].CGColor];
        
        
        [layer drawRect:CGRectMake(100 + i, 100 + i, 100, 100) fillColor:[UIColor greenColor].CGColor strokeColor:[UIColor redColor].CGColor];
//        [layer drawStartPoint:CGPointMake(100, 100) endPoint:CGPointMake(150, 150) strokeColor:[UIColor redColor].CGColor];

        [self.view.layer addSublayer:layer];

    }
    NSLog(@"end");
//    CAShapeLayer * layer = [CAShapeLayer layer];
//    [layer drawStartPoint:CGPointMake(100, 100) endPoint:CGPointMake(150, 150) strokeColor:[UIColor redColor].CGColor];
//    _shadowLayer = layer;
//    [self.view.layer addSublayer:layer];
//
//    self.rectLayer = [CAShapeLayer layer];
//    [self.rectLayer drawRect:CGRectMake(200, 100, 40, 40) fillColor:[UIColor redColor].CGColor strokeColor:[UIColor greenColor].CGColor];
//    [self.view.layer addSublayer:self.rectLayer];
//
//    UIButton * btn = [[UIButton alloc] initWithFrame:CGRectMake(100, 400, 100, 100)];
//    [btn setTitle:@"点击" forState:UIControlStateNormal];
//    [btn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
//    [btn addTarget:self action:@selector(click:) forControlEvents:UIControlEventTouchUpInside];
//    [self.view addSubview:btn];
    // Do any additional setup after loading the view.
}

//- (void)click:(UIButton *)btn{
//    [_shadowLayer drawStartPoint:CGPointMake(100, 100) endPoint:CGPointMake(100, 200) strokeColor:[UIColor redColor].CGColor];
//
//    [self.rectLayer drawRect:CGRectMake(200, 100, 80, 80) fillColor:[UIColor yellowColor].CGColor strokeColor:[UIColor greenColor].CGColor];
//}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
